package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.UserAuthsInfoResponse
import com.gexiaobao.pigeon.app.model.bean.VisitMemberListResponse
import com.gexiaobao.pigeon.databinding.ItemUserForShedListBinding
import com.gexiaobao.pigeon.databinding.ItemVisitMemberListBinding

/**
 * @Author      : hxw
 * @Date        : 2024/6/6 14:28
 * @Describe    :
 */
class UserForShedListAdapter(data: ArrayList<UserAuthsInfoResponse.ListBean>) :
    BaseQuickAdapter<UserAuthsInfoResponse.ListBean, DataBindBaseViewHolder>(
        R.layout.item_user_for_shed_list, data
    ) {
    override fun convert(holder: DataBindBaseViewHolder, item: UserAuthsInfoResponse.ListBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemUserForShedListBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        if (data.size == 1) {
            holder.setGone(R.id.viewLine, true)
        } else {
            holder.setGone(R.id.viewLine, false)
        }
    }
}